﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace SellAndBuy.Web.ViewModels
{
    /// <summary>
    /// Interface for Viewmodels that support pagging
    /// </summary>
    public interface IPagedView<out TEntity>
    {

        /// <summary>
        /// Indicating whether this instance has previous page
        /// </summary>
        bool HasPreviousPage { get; }

        /// <summary>
        /// Indicating whether this instance has next page
        /// </summary>
        bool HasNextPage { get; }

        /// <summary>
        /// Get the previous page number
        /// </summary>
        int PreviousPage { get; }

        /// <summary>
        /// Get the next page number
        /// </summary>
        int NextPage { get; }

        /// <summary>
        /// Get the page items
        /// </summary>
        [UIHint("IEnumerable")]
        IEnumerable<TEntity> PageItems { get; }

        /// <summary>
        /// Get the size of the page
        /// </summary>
        int PageSize { get; }

    }
}